aboutsummaryrefslogtreecommitdiff
path: root/src/routes/@[user]/+page.svelte
blob: 758b52e7be68c032a05b01ff91efa1b773d7c3e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script lang="ts">
	import { user } from '$lib/AniList/user';

	export let data;

	// 8.5827814569536423841e0
</script>

{#await user(data.username)}
	Loading ...
{:then profile}
	{#if profile === null}
		Could not load user profile for <a
			href={`https://anilist.co/user/${data.username}`}
			target="_blank">@{data.username}</a
		>.

		<p />

		Does this user exist?
	{:else}
		<a href={`https://anilist.co/user/${profile.name}`} target="_blank" title={String(profile.id)}
			>@{profile.name}</a
		>

		<p />

		This user has watched {(profile.statistics.anime.minutesWatched / 60 / 24).toFixed(1)} days of anime
		and read
		{((profile.statistics.manga.chaptersRead * 8.58) / 60 / 24).toFixed(1)} days of manga.
	{/if}
{:catch}
	Could not load user profile for <a
		href={`https://anilist.co/user/${data.username}`}
		target="_blank">@{data.username}</a
	>.

	<p />

	Does this user exist?
{/await}

<p />

<hr />

This page is under construction!